package com.doit.day02;

public class Cat$ {
    public static Cat$ laoWang;
    private String name;
    private Integer age;
    private String gender;
    private MyFunction0 paTree;

    //静态代码块
    static {
        new Cat$();
    }

    //get和set方法
    public String name() {
        return name;
    }

    public Integer age() {
        return age;
    }

    public void age_$eq(Integer age) {
        this.age = age;
    }

    public String gender() {
        return gender;
    }

    public void catchMouse(){
        System.out.println("我干不过老鼠！！！");
    }

    public MyFunction0 paTree() {
        return paTree;
    }

    private Cat$(){
        //给老王赋值
        laoWang = this;
        //给成员变量赋值
        this.name = "Tom";
        this.age = 20;
        this.gender = "male";
        this.paTree = new MyFunction0() {
            @Override
            public void apply() {
                System.out.println("老王会上树！！！");
            }
        };
    }
}
